package cn.dujc.superkid.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @author du
 * date 2018/7/29 下午1:33
 */
public class ProcessingAnswersResult implements Parcelable{
    /**
     * page_info : {"examine_title":"图形分割与拼接 自测卷A","num":9,"examine_score":9,"achievement":0,"when":"","answer_num":29}
     * score_statistics : [{"group_name":"100分","score":34.48,"color":"#70DB93"}]
     */

    private PageInfoEntity page_info;//页面信息
    private List<ScoreStatisticsEntity> score_statistics;//考试得分统计（饼图）

    public PageInfoEntity getPage_info() { return page_info;}

    public void setPage_info(PageInfoEntity page_info) { this.page_info = page_info;}

    public List<ScoreStatisticsEntity> getScore_statistics() { return score_statistics;}

    public void setScore_statistics(List<ScoreStatisticsEntity> score_statistics) { this.score_statistics = score_statistics;}

    @Override
    public int describeContents() { return 0; }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.page_info, flags);
        dest.writeTypedList(this.score_statistics);
    }

    public ProcessingAnswersResult() {}

    protected ProcessingAnswersResult(Parcel in) {
        this.page_info = in.readParcelable(PageInfoEntity.class.getClassLoader());
        this.score_statistics = in.createTypedArrayList(ScoreStatisticsEntity.CREATOR);
    }

    public static final Creator<ProcessingAnswersResult> CREATOR = new Creator<ProcessingAnswersResult>() {
        @Override
        public ProcessingAnswersResult createFromParcel(Parcel source) {return new ProcessingAnswersResult(source);}

        @Override
        public ProcessingAnswersResult[] newArray(int size) {return new ProcessingAnswersResult[size];}
    };

    public static class PageInfoEntity implements Parcelable {
        /**
         * examine_title : 图形分割与拼接 自测卷A
         * num : 9
         * examine_score : 9
         * achievement : 0
         * when :
         * answer_num : 29
         */

        private String examine_title;//考试标题
        private String num;//题目数量
        private String examine_score;//考试得分
        private String achievement;//本次得分
        private String when;//本次考试用时
        private String answer_num;//总答题人数

        public String getExamine_title() { return examine_title;}

        public void setExamine_title(String examine_title) { this.examine_title = examine_title;}

        public String getNum() { return num;}

        public void setNum(String num) { this.num = num;}

        public String getExamine_score() { return examine_score;}

        public void setExamine_score(String examine_score) { this.examine_score = examine_score;}

        public String getAchievement() { return achievement;}

        public void setAchievement(String achievement) { this.achievement = achievement;}

        public String getWhen() { return when;}

        public void setWhen(String when) { this.when = when;}

        public String getAnswer_num() { return answer_num;}

        public void setAnswer_num(String answer_num) { this.answer_num = answer_num;}

        @Override
        public int describeContents() { return 0; }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.examine_title);
            dest.writeString(this.num);
            dest.writeString(this.examine_score);
            dest.writeString(this.achievement);
            dest.writeString(this.when);
            dest.writeString(this.answer_num);
        }

        public PageInfoEntity() {}

        protected PageInfoEntity(Parcel in) {
            this.examine_title = in.readString();
            this.num = in.readString();
            this.examine_score = in.readString();
            this.achievement = in.readString();
            this.when = in.readString();
            this.answer_num = in.readString();
        }

        public static final Creator<PageInfoEntity> CREATOR = new Creator<PageInfoEntity>() {
            @Override
            public PageInfoEntity createFromParcel(Parcel source) {return new PageInfoEntity(source);}

            @Override
            public PageInfoEntity[] newArray(int size) {return new PageInfoEntity[size];}
        };
    }

}
